package com.itheima.reader;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;

/*
一次读取一个数组的方法
 */
public class Demo02 {


    public static void main(String[] args) throws IOException {
        FileReader reader = new FileReader("d:\\dldl.txt", Charset.forName("GBK"));
        char [] chars= new char[1024];
        int len;
        while ((len= reader.read(chars))!=-1) {
            System.out.println("读到了"+len+"个字");
            System.out.println(chars);
        }
        //reader.close();

    }
}
